<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="ie=edge" />
        <title>Document</title>
        <script src="../vue.js"></script>
    </head>
    <body>
        <div id="app">{{msg}}</div>
        <script>
            let vm = new Vue({
                el: '#app',
                data() {
                    return {
                        msg: 'Hello',
                    };
                },
                methods: {
                    handleClick() {
                        this.$nextTick(() => {
                            console.log('所有的DOM更新完成之后执行');
                        });
                    },
                },
            });
            vm.msg = 'world';
            console.dir(vm.$el.textContent); // 'Hello'
            Vue.nextTick(function () {
                console.dir(vm.$el.textContent === 'world');  // true
            });
            // console.dir(vm.$el.textContent === 'world'); // false
            // console.log(vm.msg);
        </script>
    </body>
</html>
